package party.damao.issue.controller;

import com.querydsl.core.types.Predicate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.querydsl.binding.QuerydslPredicate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import party.damao.issue.entity.TVersion;
import party.damao.issue.service.IService;
import party.damao.issue.service.VersionService;

@RestController
@RequestMapping("/api/version")
public class VersionController extends AbstractController<TVersion, Integer> {
    @Autowired
    private VersionService service;

    @Override
    public IService<TVersion, Integer> getService() {
        return service;
    }

    @Override
    public Object list(@QuerydslPredicate(root = TVersion.class) Predicate predicate, Pageable pageable) throws Exception {
        return service.list(predicate, pageable);
    }
}
